package sg.edu.nus.iss.vmcs.maintenance;

/*
 * Copyright 2011 ISS.
 * The contents contained in this document may not be reproduced in any
 * form or by any means, without the written permission of ISS, other
 * than for the purpose for which it has been supplied.
 *
 */

import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

/**
 * This class represents the control object that monitors the Transfer Cash Button
 * and performs the required action in response to the button being pressed.
 * It implements ActionListener interface from Java AWT Event Package.
 * 
 * @version 1.0  08/12/2011
 * @author Team 7S - SE19
 */

public class TransferCashButtonListener implements ActionListener {

	private MaintenanceController mctrl;

/**
 * This constructor creates an instance of the Transfer Cash Button Listener.
 * @param mc Maintenance Controller
 * @see MaintenanceController
 */
	public TransferCashButtonListener(MaintenanceController mc) {
		mctrl = mc;
	}

/**
 * Invoked when an action occurs on the Transfer Cash Button 
 * Implemented as a part of interface.
 * @param e ActionEvent 
 * @see MaintenanceController#transferAll()
 */	
	public void actionPerformed(ActionEvent e) {
		mctrl.transferAll();
	}
}